package v3.chapter7.stateTest2;

public class Run {

	// NEW,
	// RUNNABLE,
	// TERMINATED,

	// BLOCKED,
	// WAITING,
	// TIMED_WAITING,
	public static void main(String[] args) {
		try {
			MyThread t=new MyThread();
			t.start();
			Thread.sleep(1000);
			System.out.println(t.getName()+"方法中的状态："+t.getState());
		}catch(InterruptedException e) {
			e.printStackTrace();
		}
	}
}

class MyThread extends Thread{
	@Override
	public void run() {
		try {
			System.out.println("begin sleep");
			Thread.sleep(10000);
			System.out.println("  end sleep");
		}catch(InterruptedException e) {
			e.printStackTrace();
		}
	}
}